#include "pm/tagsummary.h"

using namespace pm;


TagSummary::TagSummary(wxSQLite3ResultSet& res)
: m_idTag    (res.GetInt   (wxT("id_tag")))
, m_tagName  (res.GetString(wxT("tag_name")))
, m_cost     (res.GetDouble(wxT("cost")))
, m_idProject(res.GetInt   (wxT("id_project")))
{
}

GetTagSummary::GetTagSummary(db::ID idProject)
: m_idProject(idProject)
{
}

wxSQLite3Statement GetTagSummary::prepare(wxSQLite3Database& db)
{
	wxSQLite3Statement stmt = db.PrepareStatement("select id_tag, tag_name, cost, id_project from view_tags_summary where id_project = ?");
	stmt.Bind(1, m_idProject);
	return stmt;
}
